#pragma once

#include "stdafx.h"

class OgreException {
private:
	std::string    message;
public:
	OgreException(const std::string& m = ""):message(m){};
	~OgreException(){};

	// Return the error message string associated with the exception.
	const std::string& Message(void) { return message; };
};

class InitOgreApp : public Ogre::FrameListener , public Ogre::WindowEventListener
{
protected:
	Ogre::Root* m_Root;
	Ogre::RenderWindow* m_Window;
	Ogre::SceneManager* m_SceneManager;
	//Camera
	Ogre::Camera* m_MainCamera;
public:
	InitOgreApp(void);
	~InitOgreApp(void);

	void InitApp();
	void Render();
	void FullScreen();

protected://Over Write
	virtual void CreateRenderWindow();
	virtual void SetViewport();
	virtual void SetCamera();
	virtual void SetLight();

	virtual void SetListener();// Frame,Mouse,Keyboard

protected://Call Back Functions
	//Frame Update
	virtual bool frameRenderingQueued( const Ogre::FrameEvent &_evt ) = 0; 
	//Window Event
	virtual void windowResized( Ogre::RenderWindow *_rwin );
};

